package io.renren.modules.matlist.controller;

import io.renren.modules.matlist.service.PalletService;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/api/pallet")
public class PalletController {
    private final PalletService palletService;

    public PalletController(PalletService palletService) {
        this.palletService = palletService;
    }

    @PostMapping
    public ResponseEntity<String> getPalletInfo(@RequestBody Map<String, String> body) {
        String container = body.get("Container");
        String response = palletService.getPalletInfo(container);
        return ResponseEntity.ok(response);
    }
}
